home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 5
/
Aminet 5 - March 1995.iso
/
Aminet
/
misc
/
amag
/
AM9410_2.lha
/
Haufenweise
/
Programme
/
AllocVec.c
< prev
next >
Wrap
C/C++ Source or Header
|
1994-07-15
|
373b
|
25 lines
#include <exec/types.h>
#include <clib/exec_protos.h>
void *AllocVec(ULONG Size, ULONG Flags)
{
APTR mem = 0L;
ULONG memlen = Size + sizeof(ULONG);
if (mem = AllocMem(memlen,Flags))
{ *(ULONG *)mem = memlen;
mem = (ULONG *)mem + 1;
}
return mem;
}
void FreeVec(APTR mem)
{
mem = ((ULONG *)mem - 1);
FreeMem(mem, *(ULONG *)mem);
}